#include <jsi/test/testlib.h>

using namespace facebook::jsi;

class JSITest : public JSITestBase {};

TEST_P(JSITest, Hello) {
  testing::internal::CaptureStdout();
  const char defaultScript[] = R"(
    function main() {
      console.log(`hello qjs`)
    }
    main()
  )";
  std::string scriptStr(defaultScript);
  rt.evaluateJavaScript(std::make_unique<facebook::jsi::StringBuffer>(scriptStr), "<test_code>");
  std::string output = testing::internal::GetCapturedStdout();
  EXPECT_EQ(output, "hello qjs\n");
}